import sqlite3
import math

if __name__ == '__main__':
    table_name = 'pidata'
    conn = sqlite3.connect('d://pidata.sqlite3')
    c = conn.cursor()
    
    sql = 'select count(*) from %s' % table_name

    c.execute(sql)  
    r = c.fetchone()
    print 'row number =',r[0]
